package com.techchat.backend.model;

import lombok.Data;

@Data
public class SafeUser {
    private Long id;
    private String username;
    private String nickname;
    private String avatar;

    public static SafeUser fromUser(User user) {
        SafeUser safe = new SafeUser();
        safe.setId(user.getId());
        safe.setUsername(user.getUsername());
        safe.setNickname(user.getNickname());
        safe.setAvatar(user.getAvatar());
        return safe;
    }
}
